//
//  HMStatusBottomView.m
//  OC新浪微博
//
//  Created by wyman on 16/4/16.
//  Copyright © 2016年 wyman. All rights reserved.
//

#import "HMStatusBottomView.h"
#import "UIButton+Extension.h"
#import <Masonry.h>
@interface HMStatusBottomView()
@property (nonatomic, strong) UIButton *retweetButton;
@property (nonatomic, strong) UIButton *commentButton;

@property (nonatomic, strong) UIButton *likeButton;

@end

@implementation HMStatusBottomView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame: frame]) {
        [self prepareUI];
    }
    return self;
}

-(void)prepareUI{
//添加到负空间
    [self addSubview:self.retweetButton];
    [self addSubview:self.commentButton];
    [self addSubview:self.likeButton];
    
    [self.retweetButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.top.bottom.equalTo(self);
    }];
    
    [self.commentButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.retweetButton.mas_trailing);
        make.top.equalTo(self);
        make.bottom.equalTo(self);
        make.width.equalTo(self.retweetButton);
    }];
    
    [self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.commentButton.mas_trailing);
        make.top.bottom.trailing.equalTo(self);
        make.width.equalTo(self.commentButton);
    }];



}
//懒加载三个按钮
-(UIButton *)retweetButton{
    if (_retweetButton == nil) {
        _retweetButton = [[UIButton alloc]initWithimage:@"timeline_icon_retweet" withTitle:@"转发"];
}

    return _retweetButton;
}

-(UIButton *)commentButton{
    if (_commentButton == nil) {
        _commentButton = [[UIButton alloc]initWithimage:@"timeline_icon_comment" withTitle:@"评论"];
    }
    return _commentButton;
}

-(UIButton *)likeButton{
    if (_likeButton == nil) {
        _likeButton = [[UIButton alloc]initWithimage:@"timeline_icon_unlike" withTitle:@"赞"];
    }
    return _likeButton;
}

@end
